using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;

namespace MalwareMultiScan.Backends.Interfaces
{
    /// <summary>
    /// Scan backend.
    /// </summary>
    public interface IScanBackend
    {
        /// <summary>
        /// Unique backend id.
        /// </summary>
        public string Id { get; }
        
        /// <summary>
        /// Scan file.
        /// </summary>
        /// <param name="path">File path.</param>
        /// <param name="cancellationToken">Cancellation token.</param>
        /// <returns>List of detected threats.</returns>
        public Task<string[]> ScanAsync(string path, CancellationToken cancellationToken);
        
        /// <summary>
        /// Scan URL.
        /// </summary>
        /// <param name="uri">URL.</param>
        /// <param name="cancellationToken">Cancellation token.</param>
        /// <returns>List of detected threats.</returns>
        public Task<string[]> ScanAsync(Uri uri, CancellationToken cancellationToken);
        
        /// <summary>
        /// Scan stream.
        /// </summary>
        /// <param name="stream">Stream.</param>
        /// <param name="cancellationToken">Cancellation token.</param>
        /// <returns>List of detected threats.</returns>
        public Task<string[]> ScanAsync(Stream stream, CancellationToken cancellationToken);
    }
}